package com.microframework.base.data.config;

import java.util.HashMap;
import java.util.Map;

import com.microframework.base.data.config.base.BaseConnectionConfig;

import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper = true)
public class HttpConnectionConfig extends BaseConnectionConfig {
    public enum HttpMethod {
        GET, POST, PUT, DELETE, PATCH, HEAD
    }

    private String url;
    private HttpMethod method = HttpMethod.GET;
    private Map<String, String> headers = new HashMap<>();
    private Map<String, String> queryParams = new HashMap<>();
    private String body;
    private AuthConfig authConfig;
    
    @Data
    public static class AuthConfig {
        public enum AuthType {
            NONE, BASIC, BEARER_TOKEN, OAUTH2
        }
        
        private AuthType type = AuthType.NONE;
        private String username;
        private String password;
        private String token;
        private String tokenUrl;
        private String clientId;
        private String clientSecret;
    }
}